# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Paul Bredbury <brebs@sent.com>

pkgname=jnettop
pkgver=0.13.0
pkgrel=9
pkgdesc="A top-like console network traffic visualizer"
arch=(loong64 x86_64)
url="https://web.archive.org/web/20160703195221/http://jnettop.kubs.info/wiki/"
license=('GPL')
depends=('libpcap' 'glib2' 'db5.3')
makedepends=('pkgconfig')
source=("https://web.archive.org/web/20161221100811/http://jnettop.kubs.info/dist/$pkgname-$pkgver.tar.gz")
sha512sums=('304293cd011ce8556aabf69e91b2e831ac61aa43016bb5b616d24b45805315a815dfba37dfe9f7cd3c637931043d4123b2f46a7637ba1a0b9d30267fe6dcb051')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"  
  sed -i 's/-ldb/-ldb-5.3/g' configure
}

build() {
  cd "$srcdir/$pkgname-$pkgver"

  ./configure CPPFLAGS="-I/usr/include/db5.3" --prefix=/usr --mandir=/usr/share/man
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
}
